/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package metodos_estaticos_tema3;

import java.util.Scanner;

/**
 *
 * @author Alex
 */
public class ejer_13_factorial {

    /**
     * @param args the command line arguments
     */
    public static void main(String args []) {
     Scanner teclado = new Scanner (System.in);
        
        String cad ;
       
         int n;  
         
        System.out.println("Dime un numero: ");
        cad=teclado.nextLine(); 
        n=Integer.parseInt(cad);
        
        long factorial;
        factorial=ejer_13_factorial.calcularfactorial(n);
            System.out.println("El factorial de "+n+" es "+factorial);
    }
   
    

     public static long calcularfactorial(int n) 
    
     {
        long fact=1;
         for (int cont=1;cont<=n;cont++)          
         {
        fact*=cont;
         }
         return fact;
         }
     }





